package com.gamesa.osb.reports.utils;

public class Constants {

	public static final long MAX_PSERVICE_REGISTERS = 10000;
	
	public static final long MAX_APPLICATION_REGISTERS = 20000;
	
	public static final String PROXY_SERVICE_QUERY =  
			" SELECT INBOUND_SERVICE_URI, MSG_LABELS, COUNT(*) as ACCESOS " +
			" FROM WLI_QS_REPORT_ATTRIBUTE " +
			" WHERE ROWNUM < " + MAX_PSERVICE_REGISTERS +
			" AND DB_TIMESTAMP BETWEEN ?  AND ? " +
			" AND INBOUND_SERVICE_URI like ? " +
			" AND STATE = 'REQUEST' " +
			" GROUP BY INBOUND_SERVICE_URI, MSG_LABELS" +
			" ORDER BY MSG_LABELS, INBOUND_SERVICE_URI";

	public static final String APPLICATION_CLIENT_QUERY =  
			" SELECT MSG_LABELS, INBOUND_SERVICE_URI, COUNT(*) as ACCESOS " +
			" FROM WLI_QS_REPORT_ATTRIBUTE " +
			" WHERE ROWNUM < " + MAX_APPLICATION_REGISTERS +
			" AND DB_TIMESTAMP BETWEEN ?  AND ? " +
//			" AND (MSG_LABELS like '%codClientApp=%'||?||';codProxyService=%' " +
//			" OR MSG_LABELS like '%codProxyService=%'||?) " +
			" AND (MSG_LABELS like '%CODE=%'||?||';DESC=%' " +
			" OR MSG_LABELS like '%DESC=%'||?) " +
			" AND STATE = 'REQUEST' " +
			" GROUP BY MSG_LABELS, INBOUND_SERVICE_URI" +
			" ORDER BY MSG_LABELS, INBOUND_SERVICE_URI";
		
	public static final String FIND_PROXY_SERVICES_QUERY = "select MSG_GUID, DB_TIMESTAMP, " +
			" LOCALHOST_TIMESTAMP, HOST_NAME," +
			" STATE, NODE, PIPELINE_NAME, STAGE_NAME, INBOUND_SERVICE_NAME, INBOUND_SERVICE_URI," +
			" INBOUND_OPERATION, OUTBOUND_SERVICE_NAME, OUTBOUND_SERVICE_URI, OUTBOUND_OPERATION," +
			" MSG_LABELS, ERROR_CODE, ERROR_REASON, ERROR_DETAILS from WLI_QS_REPORT_ATTRIBUTE" +
			" where DB_TIMESTAMP BETWEEN ?  AND ? " +
			" AND INBOUND_SERVICE_URI like ? " +
			" AND STATE = 'REQUEST' ";
	
	public static final String FIND_APPLICATION_CLIENT_QUERY = "select MSG_GUID, DB_TIMESTAMP, " +
			" LOCALHOST_TIMESTAMP, HOST_NAME," +
			" STATE, NODE, PIPELINE_NAME, STAGE_NAME, INBOUND_SERVICE_NAME, INBOUND_SERVICE_URI," +
			" INBOUND_OPERATION, OUTBOUND_SERVICE_NAME, OUTBOUND_SERVICE_URI, OUTBOUND_OPERATION," +
			" MSG_LABELS, ERROR_CODE, ERROR_REASON, ERROR_DETAILS from WLI_QS_REPORT_ATTRIBUTE" +
			" where DB_TIMESTAMP BETWEEN ?  AND ? " +
			" AND (MSG_LABELS like '%codClientApp=%'||?||'%codProxyService=%' " +
			" OR MSG_LABELS like '%codProxyService=%'||?||'%') " +
//			" AND (MSG_LABELS like '%CODE=%'||?||'%DESC=%' " +
//			" OR MSG_LABELS like '%DESC=%'||?||'%') " +
			" AND STATE = 'REQUEST' ";
	
	public static final String FIND_ALL_REGISTERS_QUERY = "select MSG_GUID, DB_TIMESTAMP, " +
			" LOCALHOST_TIMESTAMP, HOST_NAME," +
			" STATE, NODE, PIPELINE_NAME, STAGE_NAME, INBOUND_SERVICE_NAME, INBOUND_SERVICE_URI," +
			" INBOUND_OPERATION, OUTBOUND_SERVICE_NAME, OUTBOUND_SERVICE_URI, OUTBOUND_OPERATION," +
			" MSG_LABELS, ERROR_CODE, ERROR_REASON, ERROR_DETAILS " +
			" from WLI_QS_REPORT_ATTRIBUTE" +
			" where STATE = 'REQUEST' ";
	
	public static final String SERVICE_SELECTED = "S";
	
	public static final String APPLICATION_SELECTED = "A";
	
	public static final String VIEW_ALL = "A";
	
	public static final String VIEW_RANGE = "R";
	
	public static final String APPLICATION_CODE = "CODE";

	public static final String SERVICE_CODE = "DESC";
	
	public static final String FORMAT_DATE = "dd/mm/yyyy";
	
	public static final String INITIAL_TIME = "00";
	
}
